<?php

include_once "../../../../classes/Content_blog.php";
$CB = new Content_blog($_REQUEST['id']);
$content = $CB->get_content();
$meta_tags = $CB->get_meta();
$meta_tags = $meta_tags[0];

$data = array();

$data['type'] = 0;
$data['html'] = '
    <form method="post" action="">
        <div id="save_html" data-id="'.$_REQUEST['id'].'">Зберегти</div>
        <table class="content">
            <tr>
                <td>
                    <label for="title">Title:</label>
                </td>
                <td>
                    <input type="text" name="title" value="'.$meta_tags['title'].'"/>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="keywords">Keywords:</label>
                </td>
                <td>
                    <input type="text" name="keywords" value="'.$meta_tags['keywords'].'"/>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="description">Description: </label>
                </td>
                <td>
                    <textarea name="description">'.$meta_tags['description'].'</textarea>
                </td>
            </tr>
        </table>

        <textarea class="html_content" name="content">'.$content[0]['content'].'</textarea>
    </form>
';

echo(json_encode($data));